home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / mips / include / asm / mach-au1x00 / gpio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  1.3 KB  |  70 lines

  1. #ifndef _AU1XXX_GPIO_H_
  2. #define _AU1XXX_GPIO_H_
  3.  
  4. #include <linux/types.h>
  5.  
  6. #define AU1XXX_GPIO_BASE    200
  7.  
  8. struct au1x00_gpio2 {
  9.     u32    dir;
  10.     u32    reserved;
  11.     u32    output;
  12.     u32    pinstate;
  13.     u32    inten;
  14.     u32    enable;
  15. };
  16.  
  17. extern int au1xxx_gpio_get_value(unsigned gpio);
  18. extern void au1xxx_gpio_set_value(unsigned gpio, int value);
  19. extern int au1xxx_gpio_direction_input(unsigned gpio);
  20. extern int au1xxx_gpio_direction_output(unsigned gpio, int value);
  21.  
  22.  
  23. /* Wrappers for the arch-neutral GPIO API */
  24.  
  25. static inline int gpio_request(unsigned gpio, const char *label)
  26. {
  27.     /* Not yet implemented */
  28.     return 0;
  29. }
  30.  
  31. static inline void gpio_free(unsigned gpio)
  32. {
  33.     /* Not yet implemented */
  34. }
  35.  
  36. static inline int gpio_direction_input(unsigned gpio)
  37. {
  38.     return au1xxx_gpio_direction_input(gpio);
  39. }
  40.  
  41. static inline int gpio_direction_output(unsigned gpio, int value)
  42. {
  43.     return au1xxx_gpio_direction_output(gpio, value);
  44. }
  45.  
  46. static inline int gpio_get_value(unsigned gpio)
  47. {
  48.     return au1xxx_gpio_get_value(gpio);
  49. }
  50.  
  51. static inline void gpio_set_value(unsigned gpio, int value)
  52. {
  53.     au1xxx_gpio_set_value(gpio, value);
  54. }
  55.  
  56. static inline int gpio_to_irq(unsigned gpio)
  57. {
  58.     return gpio;
  59. }
  60.  
  61. static inline int irq_to_gpio(unsigned irq)
  62. {
  63.     return irq;
  64. }
  65.  
  66. /* For cansleep */
  67. #include <asm-generic/gpio.h>
  68.  
  69. #endif /* _AU1XXX_GPIO_H_ */
  70.